<template>
  <view>
    <view class="w100 h-444 absolute" style="background: linear-gradient(to bottom,#BAD8FF,#F7F7F7);"></view>
    <uni-nav-bar left-icon="back" class="fw-b" @clickLeft="goBack()" backgroundColor="rgba(0,0,0,0)" :border="false"></uni-nav-bar>
    <view class="w100 rowscl pt-24 rowsm mb-20">
      <image :src="userInfo.userImage" class="w-118 h-118 br-59 mb-20" style="border: 2rpx solid #487EFF;" mode=""></image>
      <view class="fs-36 col333 fw-b mb-10">{{userInfo.name}}</view>
      <view class="fs-28 col666">{{userInfo.stNumber}}</view>
    </view>
    
    <view class="w100 relative pl-20 pr-20">
      <view class="w100 h-160 br-16 bgff rowsa rowsm tct">
        <!-- <view class="rowscl rowsm">
          <view class="fs-28 col333 fw-b mb-2">{{userInfo.sex}}</view>
          <view class="fs-22 col999">性别</view>
        </view> -->
        <view class="rowscl rowsm">
          <view class="fs-28 col333 fw-b mb-2">{{userInfo.xyName}}</view>
          <view class="fs-22 col999">学院</view>
        </view>
        <view class="rowscl rowsm">
          <view class="fs-28 col333 fw-b mb-2">{{userInfo.zyName}}</view>
          <view class="fs-22 col999">专业</view>
        </view>
        <view class="rowscl rowsm">
          <view class="fs-28 col333 fw-b mb-2">{{userInfo.njName}}</view>
          <view class="fs-22 col999">年级</view>
        </view>
        <view class="rowscl rowsm">
          <view class="fs-28 col333 fw-b mb-2">{{userInfo.bjName}}</view>
          <view class="fs-22 col999">班级</view>
        </view>
      </view>
      
      <view class="w100 h-82 rowsc rowsm">
        <view class="rows rowsm">
          <view class="w-48 h-8" style="background: linear-gradient(to right,#F7F7F7,#4889FF);"></view>
          <view class="fs-30 col333 fw-b ml-10 mr-10">劳动教育考核方案</view>
          <view class="w-48 h-8" style="background: linear-gradient(to left,#F7F7F7,#4889FF);"></view>
        </view>
      </view>
      
      <view class="w100 p-all-30 bgff br-16 fs-28 col333">
        <view class="mb-20">1.劳动总成绩=理论成绩x20%+实践成绩x80% </view>
        <view class="mb-20">2.实践成绩=基础劳动成绩x60%+社会公益劳动成绩x10%+劳动成果成绩x10%+劳动总结报告成绩x20%</view>
        <view class="mb-20">3.基础劳动成绩=该生现有积分÷2800积分（基础劳动积分上限）x100</view>
      </view>
      
      <view class="w100 h-82 rowsc rowsm">
        <view class="rows rowsm">
          <view class="w-48 h-8" style="background: linear-gradient(to right,#F7F7F7,#4889FF);"></view>
          <view class="fs-30 col333 fw-b ml-10 mr-10">实践成绩</view>
          <view class="w-48 h-8" style="background: linear-gradient(to left,#F7F7F7,#4889FF);"></view>
        </view>
      </view>
      
      <!-- <view class="w100 h-132 rows rowsm tct fs-24 col000 fw-b">
        <view class="w-90 h100 rowsc rowsm " style="background-color: #F4F7FF;">{{data.sjcj.list1[0]}}</view>
        <view class="w-120 h100 rowsc rowsm " style="background-color: #F4F7FF;border-left: 2rpx solid rgba(112, 112, 112, .11);">{{data.sjcj.list1[1]}}</view>
        <view class="w-120 h100 rowsc rowsm " style="background-color: #F4F7FF;border-left: 2rpx solid rgba(112, 112, 112, .11);">{{data.sjcj.list1[2]}}</view>
        <view class="w-118 h100 rowsc rowsm " style="background-color: #F4F7FF;border-left: 2rpx solid rgba(112, 112, 112, .11);">{{data.sjcj.list1[3]}}</view>
        <view class="w-122 h100 rowsc rowsm " style="background-color: #F4F7FF;border-left: 2rpx solid rgba(112, 112, 112, .11);">{{data.sjcj.list1[4]}}</view>
        <view class="w100 h100 rowsc rowsm " style="background-color: #F4F7FF;border-left: 2rpx solid rgba(112, 112, 112, .11);">{{data.sjcj.list1[5]}}</view>
      </view> -->
      <view class="w100" v-if="data">
        <view class="w100 h-132 rows rowsm tct fw-b" v-for="(item,index) in data.sjcj" :key="index" :style="index == 0 ? 'background:#F4F7FF;' : index % 2 == 0 ? 'background:#fff;' : 'background:#F4F4F4;'">
          <view class="w-90 h100 rowsc rowsm fs-24 col000">{{item[0]}}</view>
          <view class="w-120 h100 rowsc rowsm fs-24" style="border-left: 2rpx solid rgba(112, 112, 112, .11);color: #4878FF;" :style="index == 0 ? 'color: #000;' : index == 1 ? 'color: #4878FF;' : 'color: #8f4c00;'" @click="goNext(index,1)">{{index == 1 ? Number(item[1]).toFixed(2) : item[1]}}</view>
          <view class="w-120 h100 rowsc rowsm fs-24" style="border-left: 2rpx solid rgba(112, 112, 112, .11);" :style="index == 0 ? 'color: #000;' : index == 1 ? 'color: #4878FF;' : 'color: #8f4c00;'" @click="goNext(index,2)">{{item[2]}}</view>
          <view class="w-118 h100 rowsc rowsm fs-24" style="border-left: 2rpx solid rgba(112, 112, 112, .11);" :style="index == 0 ? 'color: #000;' : index == 1 ? 'color: #4878FF;' : 'color: #8f4c00;'" @click="goNext(index,3)">{{item[3]}}</view>
          <view class="w-122 h100 rowsc rowsm fs-24" style="border-left: 2rpx solid rgba(112, 112, 112, .11);" :style="index == 0 ? 'color: #000;' : index == 1 ? 'color: #4878FF;' : 'color: #8f4c00;'" @click="goNext(index,4)">{{item[4]}}</view>
          <view class="w100 h100 rowsc rowsm fs-24" style="border-left: 2rpx solid rgba(112, 112, 112, .11);" :style="index == 0 ? 'color: #000;' : 'color: #8f4c00;'">{{item[5]}}</view>
        </view>
      </view>
      
      <view class="w100 h-82 rowsc rowsm">
        <view class="rows rowsm">
          <view class="w-48 h-8" style="background: linear-gradient(to right,#F7F7F7,#4889FF);"></view>
          <view class="fs-30 col333 fw-b ml-10 mr-10">理论成绩</view>
          <view class="w-48 h-8" style="background: linear-gradient(to left,#F7F7F7,#4889FF);"></view>
        </view>
      </view>
      
      <view class="w100 rowsa rowsm h-110 fs-28 col333 fw-b bgff br-20">
         <!-- @click="$tools.goNext('/pages/course/result')" -->
        <view class="">理论成绩</view>
        <view class="h100 w-2" style="background-color: rgba(112, 112, 112, .1);"></view>
        <view class="" style="color: #8f4c00;">{{data.llcj || 0}}</view>
      </view>
      
      <view class="w100 h-82 rowsc rowsm">
        <view class="rows rowsm">
          <view class="w-48 h-8" style="background: linear-gradient(to right,#F7F7F7,#4889FF);"></view>
          <view class="fs-30 col333 fw-b ml-10 mr-10">劳动教育总成绩</view>
          <view class="w-48 h-8" style="background: linear-gradient(to left,#F7F7F7,#4889FF);"></view>
        </view>
      </view>
      
      <view class="w100 h-96 rows rowsm tct fs-26 col000 fw-b">
        <view class="h100 rowsc rowsm " style="background-color: #F4F7FF;width: 33%;border-right: 2rpx solid rgba(112, 112, 112, .11);" v-for="(item,index) in data.ldjy.list1" :key="index">{{item}}</view>
        <!-- <view class="h100 rowsc rowsm " style="background-color: #F4F7FF;width: 33%;border-left: 2rpx solid rgba(112, 112, 112, .11);">理论成绩x20%</view> -->
        <!-- <view class="h100 rowsc rowsm " style="background-color: #F4F7FF;width: 34%;border-left: 2rpx solid rgba(112, 112, 112, .11);">实践成绩x80%</view> -->
      </view>
      <view class="w100 h-102 rows rowsm fs-30 col333">
        <view class="h100 rowsc rowsm " style="background-color: #fff;width: 33%;border-right: 2rpx solid rgba(112, 112, 112, .11);" v-for="(item,index) in data.ldjy.list2" :key="index">{{Number(item).toFixed(0)}}</view>
        <!-- <view class="h100 rowsc rowsm " style="background-color: #fff;width: 33%;border-left: 2rpx solid rgba(112, 112, 112, .11);">18</view> -->
        <!-- <view class="h100 rowsc rowsm " style="background-color: #fff;width: 34%;border-left: 2rpx solid rgba(112, 112, 112, .11);">72</view> -->
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        userInfo:{},
        data:null,
        id:''
      };
    },
    onShow() {
      
    },
    onLoad(e) {
      this.id = e.id
      this.getUserInfo()
      // this.getList()
    },
    methods:{
      goNext(index,i){
        // if(index == 1){
        //   if(i == 1){
        //     this.$tools.goNext('/pagesCopy/myScore/scoreLog?id=' + this.id)
        //   }else {
        //     this.$tools.goNext('/pagesCopy/myScore/detail?index=' + i + '&id=' + this.id)
        //   }
        // }
      },
      getList(){
        this.$tools.axiosFromToken('POST','prouser/getCountCj',{},'加载中').then(res => {
          if(res.code != 200) return this.$tools.showtt(res.msg)
          let {data} = res
          this.data = data
          let arr = []
          
          Object.keys(data.sjcj).sort().forEach(item => arr.push(item))
          console.log(arr)
          this.data.sjcj = arr.map(item => this.data.sjcj[item])
        })
      },
      getUserInfo(){
        this.$tools.axiosFromToken('POST','prouser/getCountCjByUser',{userId:this.id},'加载中').then(res => {
          if(res.code != 200) return this.$tools.showtt(res.msg)
          let {data} = res
          this.userInfo = data.user
          this.data = data
          let arr = []
          Object.keys(data.sjcj).sort().forEach(item => arr.push(item))
          this.data.sjcj = arr.map(item => this.data.sjcj[item])
        })
      },
      goBack() {
        this.$tools.goBack(-1);
      },
    }
  }
</script>

<style lang="scss">

</style>
